main(){
  List<Map> goodsList = [
    {"id": 1, "price": 22.68, "count": 3, "goods_name": "西瓜", "selectd": true},
    {"id": 2, "price": 11.99, "count": 3, "goods_name": "草莓", "selectd": true},
    {
      "id": 3,
      "price": 60.99,
      "count": 1,
      "goods_name": "车厘子",
      "selectd": false,
    },
    {
      "id": 4,
      "price": 11.68,
      "count": 3,
      "goods_name": "平谷大桃",
      "selectd": false,
    }
  ];

//   List<Map> selectedGoodsList = goodsList.where((item) => item['selectd']).map((item) => item as Map).toList();
//   print('选中商品个数：${selectedGoodsList.length}');
// List<Map> select = goodsList.where((ter) => ter['selectd']).map((item) => item as Map).toList();
// print('选中商品：${select.length}');
// List<Map> seleList = goodsList.where((itu) => itu['selectd']);
// print('选中商品：${seleList.length}');
List<Map> selectedList = goodsList.where((item) => item['selectd']).toList();
  print('6.1.选中的商品个数：${selectedList.length}');



  double allValue = goodsList.where((item) => item["selectd"]).fold(
      0.0, (value, element) => value + element["count"] * element["price"]);
 print('选中商品总价：${allValue.toStringAsFixed(2)}');


}